package com.example.web;

import com.example.domain.Book;

import java.util.LinkedList;
import java.util.List;

public class BookSearchResponse implements Response {
    private int code;
    private String msg;
    private long total;
    private long numOfBooksInCurrPage;
    private long pages;
    private List<Book> list;

    public List<Book> getList() {
        return list;
    }

    public void setList(List<Book> list) {
        this.list = list;
    }

    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    public long getNumOfBooksInCurrPage() {
        return numOfBooksInCurrPage;
    }

    public void setNumOfBooksInCurrPage(long numOfBooksInCurrPage) {
        this.numOfBooksInCurrPage = numOfBooksInCurrPage;
    }

    public long getPages() {
        return pages;
    }

    public void setPages(long pages) {
        this.pages = pages;
    }

    public BookSearchResponse(int code, String msg) {
        this.code = code;
        this.msg = msg;
        this.list = new LinkedList<>();
        this.total = 0;
        this.numOfBooksInCurrPage = 0;
        this.pages = 0;
    }

    public BookSearchResponse(int code, String msg, List<Book> list, long total, long numOfBooksInCurrPage, long pages) {
        this.code = code;
        this.msg = msg;
        this.list = list;
        this.total = total;
        this.numOfBooksInCurrPage = numOfBooksInCurrPage;
        this.pages = pages;
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String getMsg() {
        return msg;
    }

    @Override
    public void setMsg(String msg) {
        this.msg = msg;
    }
}
